<?php 		


/**
* 
*/
include '../function.php';
class Pddo 
{
	// public $host = localhost;
	// public $dbname = 'student';
	public $username;
	public $password;
	public $str;
	public $name;
	public $passwd;
	public $host = 'localhost';
	public $dbname ='student';
	function __construct()
	{
		$this->username = is_null($username) ? $this->username: $username;
		$this->password = is_null($password) ? $this->password: $password;
		$this->host = is_null($host) ? $this->host: $host;
		$this->dbname = is_null($dbname) ? $this->dbname: $dbname;
		var_dump($this->username,$this->password);
		
	}
	// 连接数据库
	public function _connect(){
		$dsn = "mysql:host=$host;dbname=$dbname";
	try{
			$link = new PDO($dsn,$this->username,$this->password);
		}catch (PDOException $e){
	    echo '数据库连接失败：'.$e->getMessage();
	    exit;
		}
	}
	
	// public function _insert(){
	// 	$str = "insert into from $dbname (name,passwd) value(?,?)";
	// 	$sth =$link->prepare($str);
	// 	var_dump($sth);
	// 	$sth =



	// }





}













 ?>